<template>
  <div id="app">
    <el-container>
      <el-header>
        <el-menu mode="horizontal" router :default-active="activeIndex">
          <el-menu-item index="/">首页</el-menu-item>
          <el-menu-item index="/voice-assistant">语音助手</el-menu-item>
          <el-menu-item index="/voice-chat">语音对话</el-menu-item>
        </el-menu>
      </el-header>
      <el-main>
        <router-view/>
      </el-main>
      <el-footer>
        Copyright © 2025 Robot AI智能语音助手
      </el-footer>
    </el-container>
  </div>
</template>

<script>
export default {
  name: 'App',
  data() {
    return {
      activeIndex: '/'
    };
  },
  watch: {
    $route: {
      immediate: true,
      handler(route) {
        this.activeIndex = route.path;
      }
    }
  }
};
</script>

<style>
body {
  margin: 0;
  padding: 0;
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', SimSun, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.el-header {
  padding: 0;
  border-bottom: 1px solid #eee;
}

.el-main {
  flex: 1;
  padding: 20px;
  background-color: #f5f7fa;
}

.el-footer {
  line-height: 60px;
  text-align: center;
  background-color: #F2F6FC;
  color: #909399;
  font-size: 14px;
}
</style> 